package com.travelbid.common;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class PropertyTool {

    private static Properties prop = null;
    private static String fileName = "/system.properties";
    
    public static String getValue(String theKey)
    {
        if(prop != null)
        {
            return prop.getProperty(theKey);
        }
        else
        {
            Properties prop = new Properties();
            InputStream is = null;
            try
            {
				is = PropertyTool.class.getResourceAsStream(fileName);
				prop.load(is);
				return prop.getProperty(theKey);
			} catch(Exception e) 
			{
				throw new RuntimeException("Can't read properties file");
			} finally 
			{
				try
				{
					if(is != null)
						is.close();
				} catch(IOException e) {}
			}
        }
    }
}